/**
 * begonia暂存全局设置集合
 * @author Muray on 2021.5
 *
 */
//============================================================
const be_instance_execList_temps = {};

/**
 * @public
 * @description 暂存执行队列
 * @param {string} beID [required] 实例ID
 * @param {any[] | BEAsyncList} execList [required] 执行队列
 * @returns
 */
export function saveExecList(beID, execList) {
  const unuse = !beID || !execList;
  if (unuse) {
    return;
  }
  if ((Array.isArray(execList) && execList.length > 0) || !!execList.__isAsync) {
    be_instance_execList_temps[beID] = execList;
  }
}

/**
 * @public
 * @description 加载实例绑定的执行队列
 * @param {string} beID [required] 实例id
 * @returns {any[] | BEAsyncList} 执行队列
 */
export function loadExecList(beID) {
  const execList = be_instance_execList_temps[beID];
  // be_instance_execList_temps[beID] = null;
  return execList;
}
